package shutdwon;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author aiowang
 * @description:
 * @date 2020/9/22 21:11
 */
public class TestThread {
    public static void main(String[] args) {
        while (true) {
            try {
                ExecutorService service = Executors.newFixedThreadPool(1);
                service.submit(new Runnable() {
                    public void run() {
                        try {
                            Thread.sleep(2000); //模拟处理业务
                        } catch (InterruptedException e) {
                        }
                    }
                });
                service = null;
            } catch (Exception e) {
            }
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
            }
        }
    }
}
